// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Vertical Wrap Object
// Script Author: Christan Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 73 : TYPE_VERTICALWRAP


// Static Values

// Tables

event ObjectMain
	if object[0].yvel >= 0
		if screen.cameraY >= 0x878
			temp1 = object[0].ypos
			foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
				temp0 = object[currentPlayer].ypos
				temp0 -= temp1
				Abs(temp0)
				if temp0 < 0x8C0000
					object[currentPlayer].ypos -= 0x8000000
				end if
			next
			screen.cameraY -= 0x800
			screen.yoffset -= 0x800
		end if
	end if
	if object[0].yvel <= 0
		if screen.cameraY <= 120
			temp1 = object[0].ypos
			foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
				temp0 = object[currentPlayer].ypos
				temp0 -= temp1
				Abs(temp0)
				if temp0 < 0x8C0000
					object[currentPlayer].ypos += 0x8000000
				end if
			next
			screen.cameraY += 0x800
			screen.yoffset += 0x800
		end if
	end if
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
